package io.kiki.stack.netty.command;

import java.net.InetSocketAddress;

public interface CommandFactory {

    <T extends Command> T createRequest(final Object requestObject);

    <T extends Command> T createTimeoutResponse(final InetSocketAddress address);

    <T extends Command> T createChannelClosedResponse(final InetSocketAddress address, String message);

    <T extends Command> T createSendFailedResponse(final InetSocketAddress address, Throwable throwable);

    <T extends Command> T createResponse(final Object responseObject, Command requestCmd);

    <T extends Command> T createExceptionResponse(int id, String errMsg);

    <T extends Command> T createExceptionResponse(int id, String errMsg, final Throwable t);

    <T extends Command> T createExceptionResponse(int id, ResponseType status);

    <T extends Command> T createExceptionResponse(int id, ResponseType status, final Throwable t);


}
